﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Manage.aspx.cs" Inherits="WinnerCMS.WebUI.Admin.Admin.Manage" %>

<%@ Register Src="../UC_AjaxLoading.ascx" TagName="UC_AjaxLoading" TagPrefix="uc1" %>
<!doctype html>
<html>
<head>
    <title>管理员管理</title>
    <meta http-equiv="Pragma" content="No-cach" />
    <%: Styles.Render("~/Content/Bootstrap/css") %>
    <%: Scripts.Render("~/Scripts/AdminBase") %>
    <script type="text/javascript">
        function OpenRoleList(userId) {
            $("#dialog-modal").dialog({
                height: 410,
                width: 540,
                title: "角色列表",
                modal: true
            });
            var urlC = $("#dialog-modal-url");
            urlC.attr("src", "AdminRoleList.aspx?UserID=" + userId);
            urlC.width(500);
            urlC.height(300);
        }
        function OpenRightList(userId) {
            $("#dialog-modal").dialog({
                height: 410,
                width: 540,
                title: "角色列表",
                modal: true
            });
            var urlC = $("#dialog-modal-url");
            urlC.attr("src", "UserRights.aspx?UserName=" + userId);
            urlC.width(500);
            urlC.height(300);
        }
        function OpenChangePSW(userId) {
            //$("#dialog-modal").dialog({
            //    height: 340,
            //    width: 520,
            //    title: "修改密码",
            //    modal: true
            //});
            //var urlC = $("#dialog-modal-url");
            //urlC.attr("src", "ChangePSW.aspx?UserName=" + userId);
            //urlC.width(500);
            //urlC.height(300);

            $.jqopen("ChangePSW.aspx?UserName=" + userId, { title: "修改密码", width: 500, height: 280 });
        }
    </script>

</head>
<body>
    <form id="Form1" method="post" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel2">
            <ProgressTemplate>
                <uc1:UC_AjaxLoading ID="UC_AjaxLoading2" runat="server"></uc1:UC_AjaxLoading>
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
                <asp:GridView ID="GV_List" runat="server" AutoGenerateColumns="False"
                    DataKeyNames="ID" GridLines="None" CssClass="table table-bordered table-condensed table-hover" OnRowDeleting="GV_List_RowDeleting" OnRowEditing="GV_List_RowEditing">
                    <Columns>
                        <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="true">
                            <ItemStyle Width="40px" HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="UserName" ReadOnly="true" HeaderText="用户名" />

                        <asp:TemplateField HeaderText="角色">
                            <ItemTemplate>
                                <asp:HyperLink ID="HyperLink1" runat="server"
                                    NavigateUrl='<%# Eval("ID", "javascript:OpenRoleList({0});") %>' Text="角色"></asp:HyperLink>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="80px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="权限">
                            <ItemTemplate>
                                <asp:HyperLink ID="HyperLink2" runat="server"
                                    NavigateUrl='<%# Eval("UserName", "javascript:OpenRightList(\"{0}\");") %>' Text="权限"></asp:HyperLink>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="80px" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="LastLoginIP" ReadOnly="true" HeaderText="最后登录IP">
                            <ItemStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="LastLoginTime" DataFormatString="{0:yy-MM-dd HH:mm:ss}"
                            HeaderText="最后登录时间" HtmlEncode="False" ReadOnly="true">
                            <ItemStyle HorizontalAlign="Center" Width="106px" />
                        </asp:BoundField>

                        <asp:BoundField DataField="LoginTimes" HeaderText="登录次数" ReadOnly="true">
                            <ItemStyle HorizontalAlign="Right" Width="80px" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="修改密码">
                            <ItemTemplate>
                                <asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl='<%# Eval("UserName", "javascript:OpenChangePSW(&#039;{0}&#039;)") %>' Text="修改密码"></asp:HyperLink>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="80px" />
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="lblDelete" runat="server" CausesValidation="False" OnClientClick="return confirm('您确定要删除？');"
                                    CommandName="Delete" Text="删除"></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="60px" />
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle CssClass="HeaderStyle" />
                    <PagerSettings Visible="False" />
                </asp:GridView>
                <WinnerCMS:PageNavigation ID="PageNavigation1" runat="server" OnPageChanging="PageNavigation1_PageChanging"
                    SubmitButtonClass="btn btn-default" PageSize="10">
                </WinnerCMS:PageNavigation>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
    <div id="dialog-modal">
        <iframe id="dialog-modal-url" frameborder="0" scrolling="no"></iframe>
    </div>
</body>
</html>
